<template id="myNew">
  <div class="myNew">
    <ul class="msg-list">

      <li class="msg-item row bg_ff">
        <i class="icon iconfont icon-tongzhi1"></i>
        <div class="col msg-right" v-if="notify_arr1" @click="goPage('/mine/myNew_details', notify_arr1)">
          <div class="row msg-top">
            <span class="col-50 tl col_333">通知公告</span>
            <p class="unread" v-if="notify_arr1.typeNum">{{notify_arr1.typeNum}}</p>
            <span class="col-50 tr msg-date">{{notify_arr1.findDate}}</span>
          </div>
          <p class="msg-content">
            {{notify_arr1.notifyContext}}
          </p>
        </div>
        <div  class="col msg-right" v-else>
          <div class="row msg-top">
            <span class="col-50 tl col_333">通知公告</span>
            <!--<p class="unread" v-if="notify_arr1.typeNum">{{notify_arr1.typeNum}}</p>-->
            <!--<span class="col-50 tr msg-date">{{notify_arr1.findDate}}</span>-->
          </div>
          <p class="msg-content">
            暂无通知公告
          </p>
        </div>
      </li>


      <li class="msg-item row bg_ff" >
        <i class="icon iconfont icon-tongzhi"></i>
        <div class="col msg-right" v-if="notify_arr2" @click="goPage('/mine/myNew_details', notify_arr2)">
          <div class="row msg-top">
            <span class="col-50 tl col_333">缴费提醒</span>
            <p class="unread" v-if="notify_arr2.typeNum">{{notify_arr2.typeNum}}</p>
            <span class="col-50 tr msg-date">{{notify_arr2.findDate}}</span>
          </div>
          <p class="msg-content">
              {{notify_arr2.notifyContext}}
          </p>
        </div>
        <div class="col msg-right" v-else >
          <div class="row msg-top">
            <span class="col-50 tl col_333">缴费提醒</span>
            <!--<p class="unread" v-if="notify_arr2.typeNum">{{notify_arr2.typeNum}}</p>-->
            <!--<span class="col-50 tr msg-date">{{notify_arr2.findDate}}</span>-->
          </div>
          <p class="msg-content">
            暂无缴费提醒
          </p>
        </div>
      </li>


      <li class="msg-item row bg_ff">
        <i class="icon iconfont icon-bi"></i>
        <div class="col msg-right" v-if="notify_arr3" @click="goPage('/mine/myNew_details', notify_arr3)">
          <div class="row msg-top">
            <span class="col-50 tl col_333">签约提醒</span>
            <p class="unread" v-if="notify_arr3.typeNum">{{notify_arr3.typeNum}}</p>
            <span class="col-50 tr msg-date">{{notify_arr3.findDate}}</span>
          </div>
          <p class="msg-content">
            {{notify_arr3.notifyContext}}
          </p>
        </div>
        <div class="col msg-right" v-else>
          <div class="row msg-top">
            <span class="col-50 tl col_333">签约提醒</span>
            <!--<p class="unread" v-if="notify_arr3.typeNum">{{notify_arr3.typeNum}}</p>-->
            <!--<span class="col-50 tr msg-date">{{notify_arr3.findDate}}</span>-->
          </div>
          <p class="msg-content">
            暂无签约提醒
          </p>
        </div>
      </li>

    </ul>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        notify_arr1: {},  //通告消息
        notify_arr2: {},  // 缴费消息
        notify_arr3: {}    // 签约消息
      }
    },
    methods: {
      goPage:function (url, item) {
        this.$router.push({path: url, query: item});
      }
    },
    //获取后台数据，dom渲染之前
    created: function(){
      var that = this;
      this.$post(this.$urlAll.query_notity, {openAccount: sessionStorage.getItem('userId')}).then(function (response) {
        that.notify_arr1 = response.t.bNotifyList1[0];
        that.notify_arr2 = response.t.bNotifyList2[0];
        that.notify_arr3 = response.t.bNotifyList3[0];

      })
    }
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  @import "../../style/common.css";
  .msg-item .iconfont{
    width: 0.42rem;
    height: 0.42rem;
    text-align: center;
    line-height: 0.42rem;
    flex: none;
    color: #ffffff;
    margin: 0 0.1rem;
    -webkit-border-radius: 0.05rem;
    -moz-border-radius: 0.05rem;
    border-radius: 0.05rem;
    font-size: 0.28rem;
  }
  .msg-item .iconfont.icon-tongzhi1{
    background: #ff4444;
  }
  .msg-item .iconfont.icon-tongzhi{
    background: #00AAEE;
  }
  .msg-item .iconfont.icon-bi{
    background: #00C192;
  }
  .msg-item{
    height: 0.64rem;
    margin-bottom: 0.01rem;
    align-items:center;
  }
  .msg-item .msg-right{
    margin-right: 0.15rem;
    width: calc(100% - .77rem);
  }
  .msg-item .msg-right span:first-child{
    font-size: 0.16rem;
  }
  .msg-item .msg-right .msg-top{
    position: relative;
    align-items: center;
  }
  .msg-item .msg-right .msg-date{
    font-size: 0.11rem;
    color: #cccccc;
    padding-right: 0.15rem;
  }
  .msg-item .msg-content{
    font-size: 0.13rem;
    color: #999999;
    padding-top: 0.08rem;
    overflow: hidden;
    -ms-text-overflow: ellipsis;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .msg-item .unread{
    min-width: 0.13rem;
    padding: 0.01rem;
    height: 0.13rem;
    line-height: 0.13rem;
    font-size: 0.06rem;
    text-align: center;
    position: absolute;
    left: 0.62rem;
    top: 0;
    color: #ffffff;
    background: #ff0000;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    cursor: pointer;
  }
</style>
